In instant messaging applications, a current method for adding friends is to search for a corresponding friend by inputting a nickname or user account to be added as a friend and add the searched friend. This method for adding friends may leak user information, causing the user being harassed due to the leakage of the user information.